
  <!-- IAM user partial -->
  <script id="services.iam.users.partial" type="text/x-handlebars-template">
    <div id="resource-name" class="list-group-item active">
      <h4 class="list-group-item-heading">{{name}}</h4>
    </div>
    <div class="list-group-item">
      <h4 class="list-group-item-heading">Information</h4>
      <div class="list-group-item-text item-margin">Arn: <span id="iam.users.{{@key}}.arn"><samp>{{value_or_none arn}}</samp></span></div>
      <div class="list-group-item-text item-margin">Creation date: {{format_date CreateDate}}</div>
    </div>
    <div class="list-group-item">
      <h4 class="list-group-item-heading">Authentication methods</h4>
      <p class="list-group-item-text item-margin">Password enabled: {{has_profiles? LoginProfile}}</p>
      <ul></ul>
      <p class="list-group-item-text item-margin">Multi-Factor enabled: <span id="iam.users.{{id}}.mfa_enabled">{{has_mfa? MFADevices}}</span></p>
      <ul class="item-margin">
      {{#each MFADevices}}
        <li class="list-group-item-text"> Serial number: {{SerialNumber}}</li>
      {{/each}}
      </ul>
      <p class="list-group-item-text item-margin">Access Keys: <span id="iam.users.{{id}}.multiple_api_keys">{{has_access_keys? AccessKeys}}</span></p>
      <ul class="item-margin">
      {{#each AccessKeys}}
        <li class="list-group-item-text"><span id="iam.users.{{@../key}}.AccessKeys.{{@key}}">{{AccessKeyId}}, {{Status}}, created on {{CreateDate}}</span></li>
      {{/each}}
      </ul>
      {{#ifHasProfiles LoginProfile}}
        {{#greaterLengthThan AccessKeys 0}}
          <p class="list-group-item-text item-margin">
            <span id="iam.users.{{id}}.password_and_keys" class="finding-hidden">
              <i class="fa fa-exclamation-triangle"></i> Review the need for password-based and key-based authentication
            </span>
          </p>
        {{/greaterLengthThan}}
      {{/ifHasProfiles }}
      {{#greaterLengthThan AccessKeys 1}}
      <p class="list-group-item-text item-margin">
          <span id="iam.users.{{id}}.multiple_active_api_keys" class="finding-hidden">
            <i class="fa fa-exclamation-triangle"></i> Review the need for multiple active access keys
          </span>
      </p>
      {{/greaterLengthThan}}
    </div>
    <div class="list-group-item">
      <h4 id="iam.users.{{id}}.user_groups" class="list-group-item-heading">Groups
        {{> count_badge count=groups.length}}
      </h4>
      <ul>
      {{#each groups}}
        <li class="list-group-item-text"><a href="javascript:showObject('services.iam.groups', 'name', '{{this}}')">{{this}}</a></li>
      {{/each}}
      </ul>
    </div>
    {{> services.iam.inline_policies resource_type = 'users' resource_id = id}}
    {{> services.iam.policies_list resource_type = 'users' resource_id = id}}
    {{#if Tags}}
    <div class="list-group-item">
      <h4>Tags</h4>
      <ul>
        {{#each Tags}}
        <li class="list-group-item-text"><samp>{{Key}}</samp>: <samp>{{Value}}</samp></li>
        {{/each}}
      </ul>
    </div>
    {{/if}}
  </script>
  <script>
    Handlebars.registerPartial("services.iam.users", $("#services\\.iam\\.users\\.partial").html());
  </script>

    <!-- Single IAM user template -->
    <script id="services.iam.users.template" type="text/x-handlebars-template">
        {{> modal-template template='services.iam.users'}}
    </script>
    <script>
        var single_iam_user_template = Handlebars.compile($("#services\\.iam\\.users\\.template").html());
    </script>
